import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '产品名称',
    align:"center",
    dataIndex: 'goodsName'
   },
   {
    title: '产品编号',
    align:"center",
    dataIndex: 'goodsNo'
   },
   {
    title: '批次号',
    align:"center",
    dataIndex: 'batchNo'
   },
   {
    title: '随行单',
    align:"center",
    dataIndex: 'noteImage',
    customRender:render.renderImage,
   },
   {
    title: '是否记录随行单',
    align:"center",
    dataIndex: 'haveDeliveryNote_dictText',
    
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "产品名称",
      field: 'goodsName',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "产品编号",
      field: 'goodsNo',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "批次号",
      field: 'batchNo',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "是否记录随行单",
      field: 'haveDeliveryNote',
      component: 'JSelectMultiple',
      componentProps:{
          dictCode:"yn"
      },
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '产品名称',
    field: 'goodsName',
    component: 'Input',
  },
  {
    label: '产品编号',
    field: 'goodsNo',
    component: 'Input',
  },
  {
    label: '批次号',
    field: 'batchNo',
    component: 'Input',
  },
  {
    label: '随行单',
    field: 'noteImage',
    component: 'Input',
  },
  {
    label: '是否记录随行单',
    field: 'haveDeliveryNote',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"yn"
     },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  goodsName: {title: '产品名称',order: 0,view: 'text', type: 'string',},
  goodsNo: {title: '产品编号',order: 1,view: 'text', type: 'string',},
  batchNO: {title: '批次号',order: 2,view: 'text', type: 'string',},
  noteImage: {title: '随行单',order: 3,view: 'text', type: 'string',},
  haveDeliveryNote: {title: '是否记录随行单',order: 4,view: 'number', type: 'number',dictCode: 'yn',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}